]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
panel: Make the "Activities" button react to touch events
authorCarlos Garnacho <carlosg@gnome.org>
Tue, 22 Jul 2014 10:32:39 +0000 (12:32 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Thu, 24 Jul 2014 16:23:17 +0000 (18:23 +0200)
https://bugzilla.gnome.org/show_bug.cgi?id=733633

js/ui/panel.js

index 6e546b0625ff354c448e8adb5a641d4eec454b13..10fe169c4d0f7cfc3345cbe3b062de61151a035f 100644 (file)
@@ -571,7 +571,7 @@ const ActivitiesButton = new Lang.Class({
         this.actor.label_actor = this._label;
 
         this.actor.connect('captured-event', Lang.bind(this, this._onCapturedEvent));
-        this.actor.connect_after('button-release-event', Lang.bind(this, this._onButtonRelease));
+        this.actor.connect_after('event', Lang.bind(this, this._onEvent));
         this.actor.connect_after('key-release-event', Lang.bind(this, this._onKeyRelease));
 
         Main.overview.connect('showing', Lang.bind(this, function() {
@@ -600,16 +600,21 @@ const ActivitiesButton = new Lang.Class({
     },
 
     _onCapturedEvent: function(actor, event) {
-        if (event.type() == Clutter.EventType.BUTTON_PRESS) {
+        if (event.type() == Clutter.EventType.BUTTON_PRESS ||
+            event.type() == Clutter.EventType.TOUCH_BEGIN) {
             if (!Main.overview.shouldToggleByCornerOrButton())
                 return Clutter.EVENT_STOP;
         }
         return Clutter.EVENT_PROPAGATE;
     },
 
-    _onButtonRelease: function() {
-        Main.overview.toggle();
-        this.menu.close();
+    _onEvent: function(actor, event) {
+        if (event.type() == Clutter.EventType.TOUCH_END ||
+            event.type() == Clutter.EventType.BUTTON_RELEASE) {
+
+            Main.overview.toggle();
+            this.menu.close();
+        }
         return Clutter.EVENT_PROPAGATE;
     },